const fs = require('fs');
const path = require('path');
const dirname = path.resolve(__dirname, './myfiles/1');
async function test() {
  await fs.promises.mkdir(dirname);
  console.log('创建目录成功');
}

// test();

const dirname1 = path.resolve(__dirname, './myfiles/444');

async function makeDir() {
  try {
    await fs.promises.mkdir(dirname1);
    // 重复创建会报错
  } catch (error) {
    console.log(error, 'error');
  }
}

makeDir();
